package main

import "fmt"

func main() {
	// 字符串
	var stringVariable1 string
	stringVariable1 = "232323sfsfsds"
	stringVariable2 := `fwefwefwefwefwefwefwefwfwefwef`

	fmt.Printf("stringVariable1 type is:%T, stringVariable2 type is:%T", stringVariable1, stringVariable2)
	fmt.Printf("stringVariable1 type is:%v, stringVariable2 type is:%v", stringVariable1, stringVariable2)
	// 长度
	fmt.Println(len(stringVariable1))

	fmt.Println("haha" + "world")

	// 字符串打印一般用%s

	var stringVariable3 = "hello, 我是大神"
	stringVariable3Len := len(stringVariable3)

	for index :=0; index < stringVariable3Len; index ++ { // 打印字符串 打印asscii 打印字符
		fmt.Printf("stringVariable3 is:%s-编码值:%d-值为:%c\n", stringVariable3, stringVariable3[index], stringVariable3[index])
	}

	// 上面这个打印有问题
	// 用下面这种
	for _, value := range stringVariable3 {
		fmt.Printf("%s-编码值:%d-值为:%c-类型:%T\n", stringVariable3, value, value, value)
	}

}
